# main.py
import sys
from PySide6.QtWidgets import QApplication
from ui.main_window import MainWindow


def main():
    # 设置matplotlib中文字体
    import matplotlib.pyplot as plt
    # 使用系统默认字体，避免指定具体字体名称
    plt.rcParams["font.family"] = ["sans-serif"]
    plt.rcParams["font.sans-serif"] = ["SimHei", "WenQuanYi Micro Hei", "Heiti TC", "Arial Unicode MS"]

    app = QApplication(sys.argv)

    # 设置应用样式
    app.setStyle("Fusion")

    # 创建并显示主窗口
    window = MainWindow()
    window.show()

    sys.exit(app.exec_())


if __name__ == "__main__":
    main()